<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/**页首栏目**/
//主页
Route::get('/', 'IndexController@index');
//帮助中心
Route::get('help','IndexController@help');


//主页点分类进入分类页面
Route::get('/stadium/{stadium_id?}','StadiumController@getStadium');

//前台登录注册
Route::group(['prefix'=>'auth', 'namespace'=>'Auth'], function(){
	//注册
	Route::get('register','AuthController@getRegister');
	Route::post('register','AuthController@postRegister');
	//登录
	Route::get('login','AuthController@getLogin');
	Route::post('login','AuthController@postLogin');
	Route::get('geetest','AuthController@getGeetest');
	//退出
	Route::get('logout','AuthController@getLogout');
});



//后台登陆注册和后台管路路由
Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){
	Route::resource('login','AdminController');
	Route::get('register','AdminController@getReg');
	Route::post('register','AdminController@postReg');
	Route::get('logout','AdminController@getLogout');
	//后台管理
	Route::get('index', 'IndexController@index');
	Route::get('catlist', 'IndexController@catlist'); //栏目列表
	Route::get('cat_edit/{pid}/{id}', 'IndexController@cat_edit'); //栏目修改
	Route::post('cat_edit', 'IndexController@post_edit'); //栏目修改
	Route::get('cat_del/{pid}/{id}', 'IndexController@cat_del'); //栏目删除
	Route::get('catadd/', 'IndexController@catadd');
	Route::post('catpost', 'IndexController@catpost');
	Route::get('gettree', 'IndexController@getTree');
	Route::get('stadiumadd', 'IndexController@stadiumadd'); //添加场馆
	Route::post('stadiumadd', 'IndexController@stadiumpost'); //添加场馆提交
	Route::get('stadiumlist', 'IndexController@stadiumlist'); //场馆列表
	Route::get('st_detail/{stadium_id}/{name}', 'IndexController@st_detail'); //场馆详情添加
	Route::post('postdetail', 'IndexController@postdetail'); //场馆详情提交
	Route::get('order', 'IndexController@order'); //订单列表
	Route::post('order_del', 'IndexController@order_del'); //经常验证
	Route::get('user', 'IndexController@user'); //用户列表
	Route::get('tree', 'IndexController@getTree'); //用户列表

});



Route::get('/home',function(){ return view('index'); });


/*//用户注册
Route::group(['prefix'=>'auth','namespace'=>'Auth'],function(){
	Route::get('login','AuthController@getLogin');
	Route::post('login','AuthController@postLogin');
	Route::get('register','AuthController@getRegister');
	Route::post('register','AuthController@postRegister');
	Route::get('logout','AuthController@getLogout');

});*/







//我的订单路由
Route::get('/order_list','OrderController@order_List');

//我的主页路由
Route::get('/homepage','OrderController@homePage');

//订单支付路由
Route::get('/pay','OrderController@getPay');

//取消订单
Route::get('/cancel_order/{order_sn}','OrderController@cancelOrder');

//选择场馆
Route::get('choose','BookController@getChoose');


//场馆详细详细展示
Route::get('stadium_detail/{stadium_id}/{date?}', 'StadiumController@detail');


//提交订单
Route::post('postorder', 'StadiumController@postorder');

//提交支付 完成支付
Route::post('paydone', 'OrderController@postPay');
